
<?php
echo $this->Html->script(array('/ajax_multi_upload/js/fileuploader'), array("inline"=>false));
echo $this->Html->css(array('/ajax_multi_upload/css/fileuploader'), null, array("inline"=>false));
echo $this->Form->create('Tour', array('type' => 'file','class'=>'form-horizontal'));?>
    <table class="table table-striped">

<!--        --><?php //foreach($listTour as $la): ?>
<!--        --><?php //var_dump($la['Tour']);die;?>
            <tr>
                <th>Tiêu đề</th>
                <td>
                    <?php echo $this->Form->input('id',array('label'=>' ','value'=>$la['Tour']['id']));?>
                    <?php echo $this->Form->input('title',array('label'=>' ','value'=> $la['Tour']['title']))?>
                </td>
            </tr>
            <tr>
                <th style="width: 200px">Giá</th>
                <td>
                    <?php echo $this->Form->input('price',array('label'=>' ','value'=>$la['Tour']['price']));?>
                </td>
            </tr>
            <tr>
                <th style="width: 200px">Khách Sạn</th>
                <td>                    <?php echo $this->Form->input('hotel_start',array('label'=>' ','value'=>$la['Tour']['hotel_start']));?>
                </td>
            </tr>
            <tr>
                <th style="width: 200px">Loại Tour</th>
                <td>
                    <?php echo $this->Form->input('tourkindgroups_id',array(
                        'label'=>' ',
                        'value'=>$la['Tour']['tour_kind_id']));
                    ?>
                </td>
            </tr>
            <tr>
                <th style="width: 200px">Ngày khởi hành</th>
                <td>
                    <?php echo $this->Form->input('start_date',array('label'=>' ','value'=>$la['Tour']['start_date']));?>
                </td>
            </tr>
            <tr>
                <th style="width: 200px">Điểm xuất phát</th>
                <td>
                    <?php echo $this->Form->input('start_point',array('label'=>' ','value'=>$la['Tour']['start_point']));?>
                </td>
            </tr>
            <tr>
                <th style="width: 200px">Lịch Trình</th>
                <td>
                    <?php echo $this->Form->input('schedule',array('label'=>' ','value'=>$la['Tour']['schedule']));?>

                </td>
            </tr>
            <tr>
                <th style="width: 200px">Ảnh minh họa</th>
                <td>
                    <?php echo $this->Html->image($la['Tour']['imageURL'],array('value' => $la['Tour']['imageURL'],'height'=>'100px', 'width'=>'300px'))?>
                    <?php
                    echo '<div class="control-group">'.$this->Upload->edit('Temp', "audio", array(
                            'inline'=>1,
                            'image'=>'',)).'</div>';
                    echo $this->Form->input('imageURL',array('type'=>'hidden', 'value' => $la['Tour']['imageURL']));
                    echo $this->Form->input('Isnew',array('value'=>0, 'type'=>'hidden'));
                    ?>
                </td>
            </tr>
            <tr>
                <th style="width: 200px">Tour Trong Nước ? </th>
                <td>
                    <?php echo $this->Form->input('is_national',array(
                        'label'=>' ',
                        'value'=>$la['Tour']['is_national'],
                        'checked' => $la['Tour']['is_national']
                    ));?>



                </td>
            </tr>
            <tr>
                <th style="width: 200px">Phương Tiện </th>
                <td>
                    <?php echo $this->Form->input('vehicle',array('label'=>' ','value'=>$la['Tour']['vehicle']));?>
                </td>
            </tr>
            <tr>
                <th style="width: 200px">Tour Nổi Bậc ? </th>
                <td>
                    <?php echo $this->Form->input('is_hightlight',array(
                        'label'=>' ',
                        'value'=>$la['Tour']['is_hightlight'],
                        'checked' => $la['Tour']['is_hightlight']

                    ));?>



                </td>
            </tr>
            <tr>
                <th>Nội dung</th>
                <td>

                    <?php echo $this->Html->script('/js/ckeditor/ckeditor.js'); ?>
                    <?php echo $this->Form->textarea('content',
                        array(
                            'value'=> $la['Tour']['content'],
                            'class'=>'ckeditor',
                            )); ?>
                </td>
            </tr>
            <tr>
                <th></th>
                <td>
                    <?php echo $this->Form->submit(__('Save', true), array('class'=>'btn btn-primary'));?>
                    <?php echo $this->Html->link(__('Cancel', true), array(
                        'action'=>'index',),
                        array(
                            'class'=>'btn-primary btn'))?>
                </td>
            </tr>
<!--        --><?php //endforeach;?>
    </table>
<?php echo $this->Form->end();?>
<?php
$webroot = Router::url("/") . "ajax_multi_upload";
$script = "function createUploader(){
    	var live_site = '$this->webroot';
	    var upload1  = new qq.FileUploader({
		element: document.getElementById('AjaxMultiUploadTemp___audio'),
		action: '$webroot/uploads/upload/Temp/',
		debug: true,
                multiple:false,
                validation: {
                        allowedExtensions: ['jpg'],
                        sizeLimit: 2100000
                    },
                onComplete: function(id, fileName, responseJSON){
                        if (responseJSON['success']) {
                	$('#TourImageURL').val(fileName);
                	$('#TourIsnew').val(1);
//                        $('#thumbTemp___audio img').attr('src', live_site+'uploads/sound.png').attr('title','Sound upload');
                        }
                },
	        });
        }
	window.onload = createUploader;";
echo $this->Html->scriptBlock(
    $script,
    array('inline' => false)
);
?>
